package com.esun.cheetah.view.setting.com;

import java.util.HashMap;

import org.json.JSONException;

import android.content.Context;
import android.os.Handler;

import com.esun.cheetah.biz.personal.personalinfo.UserInfo;
import com.esun.cheetah.config.BizCode;
import com.esun.cheetah.config.Key;
import com.esun.cheetah.network.AbsInferiorityCommunicater;
import com.esun.cheetah.view.setting.ValuesManager;

/**
 * 设置通讯 com.esun.cheetah.view.setting.com.SetCommu
 * 
 * @author 任付江 create at 2012-3-30 上午10:53:01
 */
public class SetCommu extends AbsInferiorityCommunicater {
	private Context context;
	private String beginTime;
	private String endTime;

	public SetCommu(Handler handler) {
		super(handler);
	}

	public SetCommu(Handler handler, Context context, String beginTime,
			String endTime) {
		this(handler);
		this.beginTime = beginTime;
		this.endTime = endTime;
		this.context = context;
	}

	// 组装参数
	@Override
	public HashMap<String, String> comHashMap() {
		ValuesManager valuesManage = new ValuesManager(context);
		HashMap<String, String> setMap = new HashMap<String, String>();
		setMap.put(Key.KEY_ID, BizCode.BIZCODE_UPDATE);
		setMap.put("username", UserInfo.getUserInfo().getUserName());
		setMap.put(
				"hinttype",
				ValuesManager.covert(valuesManage.isRing(),
						valuesManage.isVibrator()));
		setMap.put("starttime", beginTime);
		setMap.put("endtime", endTime);
		setMap.put("zqkc", ValuesManager.covert(valuesManage.isFbBegOrEnd()));
		setMap.put("zqjq", ValuesManager.covert(valuesManage.isGoal()));
		setMap.put("zqhp", ValuesManager.covert(valuesManage.isRedCard()));
//		setMap.put("lqkc", ValuesManager.covert(valuesManage.isBasHalf()));
//		setMap.put("lqbc", ValuesManager.covert(valuesManage.isBasBegin()));
		setMap.put("status", ValuesManager.covert(valuesManage.isParent()));
		return setMap;
	}

	@Override
	public void getJsonContent(String serverRes) throws JSONException {

	}

}